{template 'common/header'}
<div class="search-box we7-margin-bottom">
	<select name="" class="we7-margin-right">
		<option data-url="{php echo filter_url('account_type:');}" >帐号类型筛选</option>
		{loop $account_all_type_sign $type_sign $type_sign_info}
		<option data-url="{php echo filter_url('account_type:' . $type_sign);}" {if $_GPC['account_type'] == $type_sign} selected{/if}>{$type_sign_info['title']}</option>
		{/loop}
	</select>
	<form action="" class="search-form" method="get">
		<input type="hidden" name="c" value="account">
		<input type="hidden" name="a" value="recycle">
		<div class="input-group">
			<input type="text" name="keyword" value="{$_GPC['keyword']}" class="form-control" placeholder="搜索关键字"/>
			<span class="input-group-btn"><button class="btn btn-default"><i class="fa fa-search"></i></button></span>
		</div>
	</form>
</div>
<div  id="js-system-account-recycle" ng-controller="SystemAccountRecycle" ng-cloak>
	<table class="table we7-table table-hover vertical-middle table-manage">
		<col width="100px" >
		<col width="85px" />
		<col />
		<col width="208px" />
		<col width="150px" />
		<tr>
			<th class="we7-form">
				<input type="checkbox" we7-check-all="1" id="uid-all" ng-model="checkAllStatus" ng-change="checkAll()" class="">
				<label for="uid-all"></label>
			</th>
			<th colspan="2" class="text-left">帐号</th>
			<th>有效期</th>
			<th class="text-right">操作</th>
		</tr>
		<tr class="color-gray" ng-repeat="list in del_accounts">
			<td class="we7-form table-action-td" >
				<input type="checkbox" we7-check-all="1" id="{{'uid-' + list.uniacid}}" class="" ng-model="list['checked']"  ng-change="checkItem(list['checked'])">
				<label for="{{'uid-' + list.uniacid}}">&nbsp;</label>
			</td>
			<td class="text-left td-link">
				<img src="{{ list.logo }}" class="img-responsive account-img icon" >
			</td>
			<td class="text-left">
				<p class="color-dark" ng-bind="list.name"></p>
				<div ng-if="list.type == account_types.wechat_normal || list.type == account_types.wechat_auth">
					<span class="color-gray" ng-if="list.level == 1">类型：普通订阅号</span>
					<span class="color-gray" ng-if="list.level == 2">类型：普通服务号</span>
					<span class="color-gray" ng-if="list.level == 3">类型：认证订阅号</span>
					<span class="color-gray" ng-if="list.level == 4" title="认证服务号/认证媒体/政府订阅号">类型：认证服务号</span>
					<span class="color-red" ng-if="list.isconnect == 0" ><i class="wi wi-error-sign"></i>未接入</span>
					<span class="color-green" ng-if="list.isconnect == 1"><i class="wi wi-right-sign"></i>已接入</span>
				</div>
				<div ng-if="list.type == account_types.wxapp_normal || list.type == account_types.wxapp_auth || list.type == account_types.aliapp || list.type == account_types.webapp || list.type == account_types.phoneapp">
					<span class="color-gray">类型：{{ list.type_name }}</span>
				</div>
			</td>
			<td>
				<p ng-bind="list.end"></p>
			</td>
			<td class="vertical-middle">
				<div class="link-group">
					<a href="javascript:;" class="del" ng-click="recover([list.uniacid])">恢复</a>
					<a href="javascript:;" class="del" ng-click="delete([list.uniacid])">删除</a>
				</div>
			</td>
		</tr>
		<tr ng-if="del_accounts | we7IsEmpty">
			<td colspan="100">
				<div class="we7-empty-block">暂无</div>
			</td>
		</tr>
	</table>
	<div class="we7-form" style="margin-left: 14px; ">
		<input type="checkbox" we7-check-all="1" id="uid-all1" ng-model="checkAllStatus" ng-change="checkAll()" class="">
		<label for="uid-all1">全选</label>
		<span class="we7-margin-left">已选择{{checkNum}}个</span>
		<button href="javascript:;" ng-disabled="!checkNum" class="btn btn-default we7-margin-left" ng-click="postAction('recover')">恢复</button>
		<button href="javascript:;" ng-disabled="!checkNum" class="btn btn-default we7-margin-left-sm" ng-click="postAction('delete')">删除</button>
		<div class="pull-right">
			{$pager}
		</div>
	</div>
</div>
<script>
	$(function(){
		$('[data-toggle="tooltip"]').tooltip();
	});
	angular.module('accountApp').value('config', {
		del_accounts: {php echo !empty($del_accounts) ? json_encode($del_accounts) : 'null'},
		account_types : {
			'wechat_normal' : {ACCOUNT_TYPE_OFFCIAL_NORMAL},
			'wechat_auth' : {ACCOUNT_TYPE_OFFCIAL_AUTH},
			'wxapp_normal' : {ACCOUNT_TYPE_APP_NORMAL},
			'wxapp_auth' : {ACCOUNT_TYPE_APP_AUTH},
			'webapp' : {ACCOUNT_TYPE_WEBAPP_NORMAL},
			'phoneapp' : {ACCOUNT_TYPE_PHONEAPP_NORMAL},
			'aliapp' : {ACCOUNT_TYPE_ALIAPP_NORMAL},
		},
		links: {
			postRecover: "{php echo url('account/recycle/recover', array('account_type' => ACCOUNT_TYPE))}",
			postDel: "{php echo url('account/recycle/delete', array('account_type' => ACCOUNT_TYPE))}",
		}
	});

	angular.bootstrap($('#js-system-account-recycle'), ['accountApp']);
</script>

{template 'common/footer'}